package cn.wolfcode.wolf2w.business.api.domain;

import com.baomidou.mybatisplus.annotation.TableField;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import cn.wolfcode.wolf2w.common.core.annotation.Excel;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Getter;
import lombok.Setter;
import lombok.experimental.Accessors;

import java.io.Serializable;
import java.util.Date;

/**
 * 回答信息对象 ta_question_comment
 *
 * @author libai
 * @date 2024-08-12
 */
@Setter
@Getter
//@Accessors(chain = true)
@TableName("ta_question_comment")
@ApiModel(value = "回答信息实体类", description = "回答信息")
public class Answer implements Serializable {
    private static final long serialVersionUID = 1L;
    /** $column.columnComment */


    /**
     * example = "0"  必须填,特别是 Long int
     */
    @ApiModelProperty(example = "0", value = "主键", name = "id", dataType = "Long", required = true)
    @TableId(type = IdType.AUTO)
    private Long id;

    /**
     * 回答的问题
     */
    @ApiModelProperty(example = "0", value = "回答的问题id", name = "questionId", dataType = "Long", required = true)
    @Excel(name = "回答的问题")
    private Long questionId;

    /**
     * 回答的用户
     */
    @ApiModelProperty(example = "0", value = "回答的用户id", name = "userId", dataType = "Long", required = true)
    @Excel(name = "回答的用户")
    private Long userId;

    /**
     * 回复的内容
     */
    @ApiModelProperty(value = "回复内容", name = "answerContent", dataType = "String", required = true)
    @Excel(name = "回复的内容")
    private String answerContent;

    /**
     * 状态 -1 删除 0 正常
     */
    @ApiModelProperty(example = "0", value = "状态", name = "state", dataType = "Long", required = true)
    @Excel(name = "状态")
    private Long state;

    /**
     * 点赞量
     */
    @ApiModelProperty(example = "0", value = "点赞", name = "thumbsupnum", dataType = "Long", required = true)
    @Excel(name = "点赞量")
    private Long thumbsupnum;

    /**
     * 收藏量
     */
    @ApiModelProperty(example = "0", value = "收藏", name = "starnum", dataType = "Long", required = true)
    @Excel(name = "收藏量")
    private Long starnum;

    /**
     * 创建时间
     */
    @ApiModelProperty(value = "创建时间", name = "createTime", dataType = "Date", required = true)
    @JsonFormat(pattern = "yyyy-MM-dd hh:mm:ss")
    private Date createTime;

    /**
     * 修改时间
     */
    @ApiModelProperty(value = "修改时间", name = "updateTime", dataType = "Date", required = true)
    @JsonFormat(pattern = "yyyy-MM-dd hh:mm:ss")
    private Date updateTime;


    @ApiModelProperty(value = "作者名字", name = "authorName", dataType = "String", required = true)
    @TableField(exist = false)
    private String authorName;

    @ApiModelProperty(example = "0",value = "等级", name = "level", dataType = "Integer", required = true)
    @TableField(exist = false)
    private Integer level;

    @ApiModelProperty(value = "头像", name = "headImgUrl", dataType = "String", required = true)
    @TableField(exist = false)
    private String headImgUrl;


    @Override
    public String toString() {
        return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
                .append("id", getId())
                .append("questionId", getQuestionId())
                .append("userId", getUserId())
                .append("answerContent", getAnswerContent())
                .append("state", getState())
                .append("thumbsupnum", getThumbsupnum())
                .append("starnum", getStarnum())
                .append("createTime", getCreateTime())
                .append("updateTime", getUpdateTime())
                .toString();
    }
}
